package com.yty.demo._4_oop;

/**
 * @author: yangtaoyao
 * @time: 2020/1/7 14:14
 * @description: 计算圆半径
 */
public class Circle {
    private double radius;

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public Circle() {
        this.radius = 1;
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public double  calculate(){
        return 3.14*radius*radius;
    }

    public static void main(String[] args) {
        Circle circle=new Circle(10.5);
        System.out.println(circle.calculate());
    }
}
